-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repl: fix /dev/null history file regression #12762
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
lgtm I suppose
@@ -178,6 +179,21 @@ const tests = [ | |||
test: [UP], | |||
expected: [prompt] | |||
}, | |||
{ | |||
before: function before() { | |||
if (!common.isWindows) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test case passes on Windows?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, because like the test case before it, it will just act like an empty file on other platforms.
} | ||
} | ||
}, | ||
env: { NODE_REPL_HISTORY: devNullHistoryPath }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Wait, you can't just set this to /dev/null
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, because I believe Windows would then fail since /dev/null does not exists there and currently there is no way to conditionally skip a test from running, you can only make it fall back to the empty history file scenario.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, makes sense.
025b12c
to
24326a0
Compare
I've made a slight tweak to the test so that it creates the symlink in a more appropriate place now (the temp dir. instead of fixtures). CI once again: https://ci.nodejs.org/job/node-test-pull-request/7791/ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ugh. Ok. Thanks for including the test.
This fixes a regression from 83887f3 where ftruncate() fails on a file symlinked to /dev/null. PR-URL: nodejs#12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
24326a0
to
c20e87a
Compare
This fixes a regression from 83887f3 where ftruncate() fails on a file symlinked to /dev/null. PR-URL: nodejs#12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
I just noticed that the problematic commit made its way into v7.x without this fix :-(, so I've updated the tags accordingly to match that of the PR for that commit. |
This fixes a regression from 83887f3 where ftruncate() fails on a file symlinked to /dev/null. PR-URL: #12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This fixes a regression from 83887f3 where ftruncate() fails on a file symlinked to /dev/null. PR-URL: #12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This fixes a regression from 83887f3 where ftruncate() fails on a file symlinked to /dev/null. PR-URL: #12762 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Bartosz Sosnowski <bartosz@janeasystems.com> Reviewed-By: James M Snell <jasnell@gmail.com>
This fixes a regression from bb041ea where
ftruncate()
fails on a file symlinked to /dev/null./cc @bzoz @jasnell
CI: https://ci.nodejs.org/job/node-test-pull-request/7761/
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)